package shengchanxiaofeiTest;

public class Cons implements Runnable{
    @Override
    public void run() {
        while (true){
            Ware.rtl.lock();
            if(Ware.mark){
                Ware.mark = false;
                System.out.println("食客吃掉了 包子..");
                Ware.pro.signal();
            }else{
                try {
                    Ware.con.await();
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }

            }

            Ware.rtl.unlock();
        }
    }
}
